package com.ccys.app.controller;

import cn.hutool.core.util.ObjectUtil;
import com.ccys.app.service.ContactUsScreenService;
import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.dto.app.contactUsScreen.SendSupportDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: WhiteCoat
 * @description: 用户app的：联系我们 接口
 * @author: ZhangJingCan
 * @create: 2024-01-29 15:50
 **/

@RestController
@Api(tags = "用户app的：联系我们 接口")
@RequestMapping("splashscreen")
public class ContactUsScreenController {
    @Autowired
    private ContactUsScreenService contactUsScreenService;


    @ApiOperation("联系我们")
    @GetMapping(value = "/SendSupport")
    public ResponseResultApp sendSupport(SendSupportDto dto) throws Exception {
        if (ObjectUtil.isEmpty(dto.getContent_type())){
            return ResponseResultApp.error(400,"The content_type field is required.");
        }
        if (ObjectUtil.isEmpty(dto.getContent())){
            return ResponseResultApp.error(400,"The content field is required.");
        }
        return contactUsScreenService.sendSupport(dto);
    }

}
